
package com.htj.erp.service;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.kedacom.mybatis.ext.PageHelper;
import com.kedacom.security.service.GenericCpsService;
import com.htj.erp.dao.RouteDisDao;
import com.htj.erp.dao.mybatis.RouteDisMapper;
import com.htj.erp.model.jpa.RouteDis;
import com.htj.erp.model.mybatis.RouteDisPO;
import com.htj.erp.vo.RouteDisVO;

import com.kedacom.utils.BeanUtils;
import com.kedacom.utils.BeanMapper;
import com.kedacom.utils.PageUtil;
import com.kedacom.utils.vpc.Converter;
import com.kedacom.utils.vpc.DefalutConverter;
/**
 * 
 *
 * 
 * RouteDisService
 * 路程距离 service 处理类
 * 这个基本类一般继承com.kedacom.security.service.GenericCpsService
 * 如果自己实现转换类，通过重写getXXConveter方法。
 * chenghongtao
 * 2016-11-11 11:55:46
 * HTJ
 * @version 1.0.0
 *
 */
@Service
public class RouteDisService extends GenericCpsService<RouteDis,RouteDisPO,RouteDisVO,Long>  {

    
	@Resource
	private RouteDisDao routeDisDao;
	
	@Resource
	private RouteDisMapper routeDisMapper;
	
	/**
	 * 获取jpa的dao
	 */
	@Override
	protected  RouteDisDao getEntityJpaDao ()
	{
		return this.routeDisDao;
	}
	 
	  
	/**
	 * 获取 mubatis 的dao
	 */
	@Override
	protected  RouteDisMapper getEntityDao ()
	{
		return this.routeDisMapper;
	}
	
	
	
	/**
	 * 
	 * saveOrUpdate 保存或者更新
	 * @param routeDisVO
	 * @return
	 *RouteDisVO
	 * @exception
	 * @since  1.0.0
	 */
	public RouteDisVO saveOrUpdate(RouteDisVO routeDisVO) throws Exception
	{
	    if(routeDisVO.getId() == null || routeDisVO.getId() == 0L)
	    {
	        return this.add(routeDisVO);
	    }
	    else
	    {
	        return this.update(routeDisVO);
	    }
	    
	}
	
	
	
}
